<div class="tableform">
      <table cellspacing="0" cellpadding="0" border="0" class="gridlist">
        <tr>
          <td>客户</td>
          <td>客户名称</td>
          <td>料号</td>
          <td>料品</td>
          <td>单位</td>
          <td>销售数量</td>
          <td>销售金额</td>
          <td>应收运费</td>
        </tr>
    <{assign var="key" value="0"}>
    <{assign var="sumqty" value="0"}>
    <{assign var="summny" value="0"}>
    <{assign var="sumfee" value="0"}>
      <{foreach from=$res item=his}>
    <{assign var="key" value=$key+1 }>
      <{assign var="sumqty" value=$sumqty+$his.saleqty }>
      <{assign var="summny" value=$summny+$his.salemny }>
      <{assign var="sumfee" value=$sumfee+$his.lmfee }>
      <tbody>
        <tr>
          <td><{$his.AXCustomer}></td>
          <td><{$his.customername}></td>
          <td><{$his.bn}></td>
          <td><{$his.product_name}></td>
          <td><{$his.unit}></td>
          <td><{$his.saleqty}></td>
          <td><{$his.salemny}></td>
          <td><{$his.lmfee}></td>
        </tr>
        </tbody>
      <{/foreach}>
        <tr>
          <td>总数：</td>
          <td colspan="4"><{$key}></td>
          <td><{$sumqty}></td>
          <td><{$summny}></td>
          <td><{$sumfee}></td>
        </tr>
      </table>
</div>